import { ref} from 'vue'
import { defineStore } from 'pinia'
import {getLayoutAPI} from '@/apis/layout'

// 首页分类数据
export const useCategoryStore = defineStore('category', () => {
    const categoryList = ref([])
    const getLayoutData = async () => {
      const res = await getLayoutAPI();
      categoryList.value = res.result
    }
    return {
        categoryList, // 首页分类数据
        getLayoutData // 获取首页分类数据函数
    }
})
